package com.itheima.exceptionDemo;

public class ExceptionDemo03 {
    public static void main(String[] args) {
        try {
            int[] arrs = {1,2,3};
            int a = arrs[10];
            System.out.println(a);
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println(e.getMessage());//Index 10 out of bounds for length 3

            System.out.println(e.toString());
            //java.lang.ArrayIndexOutOfBoundsException: Index 10 out of bounds for length 3

            e.printStackTrace();
            /*java.lang.ArrayIndexOutOfBoundsException: Index 10 out of bounds for length 3
            at com.itheima.exceptionDemo.ExceptionDemo03.main(ExceptionDemo03.java:7)*/
        }
        System.out.println("会继续运行");
    }
}
